﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace InfFront.UICore
{
    /// <summary>
    /// Generic read-only random access container interface
    /// </summary>
    /// <typeparam name="ItemType">item type</typeparam>
    [ServiceContract(Namespace = "http://InfFront.UICore")]
    public interface IContainer<ItemType> : IEnumerable<ItemType>
    {
        /// <summary>
        /// Item count
        /// </summary>
        [OperationContract]
        int GetCount();

        /// <summary>
        /// Retrieve container item by the *index*
        /// </summary>
        /// <param name="index">the index</param>
        /// <returns>item</returns>
        [OperationContract]
        ItemType GetItem(int index);
    }
}
